﻿<ws:ApplicationView x:Class="CustomWorkspace.Modules.Core.Main.MainView" x:ClassModifier="internal" x:TypeArguments="local:IMainViewModel"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                    xmlns:ws="clr-namespace:Creventive.Wpf.ShellFactory.Workspace;assembly=Creventive.Wpf.ShellFactory"
                    xmlns:local="clr-namespace:CustomWorkspace.Modules.Core.Main"
                    xmlns:iw="clr-namespace:CustomWorkspace.Infrastructure.Workspaces;assembly=CustomWorkspace.Infrastructure"
                    xmlns:wsp="clr-namespace:Creventive.Wpf.ShellFactory.Workspace.Primitives;assembly=Creventive.Wpf.ShellFactory"
                    mc:Ignorable="d"
                    d:DesignHeight="300" d:DesignWidth="300" d:DataContext="{d:DesignInstance local:MainDesignTimeViewModel, IsDesignTimeCreatable=True}">
    <Grid>
        <iw:DetachableDeckWorkspace AllowClose="False">
            <iw:DetachableDeckWorkspace.ContainerStyle>
                <Style TargetType="{x:Type wsp:WorkspaceItem}">
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate TargetType="{x:Type wsp:WorkspaceItem}">
                                <Grid>
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto" />
                                        <RowDefinition Height="*" />
                                    </Grid.RowDefinitions>
                                    <DockPanel Height="24" Background="DarkBlue">
                                        <!-- Detachment Button -->
                                        <Button Content="Detach" DockPanel.Dock="Right" Command="{x:Static iw:DetachableDeckWorkspace.DetachCommand}" CommandParameter="{TemplateBinding ApplicationView}" CommandTarget="{TemplateBinding Workspace}" />
                                        <TextBlock Text="{TemplateBinding Title}" VerticalAlignment="Center" Foreground="White" />
                                    </DockPanel>
                                    <Border Padding="8" Grid.Row="1">
                                        <wsp:ApplicationViewPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                                    </Border>
                                </Grid>
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </Style>
            </iw:DetachableDeckWorkspace.ContainerStyle>
            <ws:ApplicationViewSource Uri="/CustomWorkspace.Modules.Core;component/DemoView1/DemoView1.xaml" />
            <ws:ApplicationViewSource Uri="/CustomWorkspace.Modules.Core;component/DemoView2/DemoView2.xaml" />
        </iw:DetachableDeckWorkspace>
    </Grid>
</ws:ApplicationView>